﻿<ResourceDictionary
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
    xmlns:FloatingPanel="clr-namespace:DeepEarth.BingMapsToolkit.Client.Controls;assembly=DeepEarth.BingMapsToolkit.Client.Controls.FloatingPanel" >

    <ResourceDictionary.MergedDictionaries>
        <ResourceDictionary Source="/DeepEarth.BingMapsToolkit.Client.Common;component/Resources/CommonStyles.xaml" />
    </ResourceDictionary.MergedDictionaries>
  
    <Style TargetType="FloatingPanel:FloatingPanel">
        <Setter Property="IsTabStop" Value="false"/>
        <Setter Property="TabNavigation" Value="Cycle"/>
        <Setter Property="HorizontalAlignment" Value="Center"/>
        <Setter Property="VerticalAlignment" Value="Center"/>
        <Setter Property="HorizontalContentAlignment" Value="Stretch"/>
        <Setter Property="VerticalContentAlignment" Value="Stretch"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="FloatingPanel:FloatingPanel">
                    <Canvas x:Name="PART_Root" HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="WindowStates">
                                <VisualState x:Name="Open">
                                    <Storyboard>
                                        <DoubleAnimationUsingKeyFrames BeginTime="0" Storyboard.TargetName="PART_Root" Storyboard.TargetProperty="Opacity">
                                            <EasingDoubleKeyFrame KeyTime="0" Value="0"/>
                                            <EasingDoubleKeyFrame KeyTime="00:00:00.3" Value="1"/>
                                        </DoubleAnimationUsingKeyFrames>
                                        <DoubleAnimationUsingKeyFrames BeginTime="0" Storyboard.TargetName="PART_ContentRoot" Storyboard.TargetProperty="(RenderTransform).(Children)[0].ScaleX">
                                            <SplineDoubleKeyFrame KeyTime="0" Value="0"/>
                                            <SplineDoubleKeyFrame KeyTime="00:00:00.25" Value="0"/>
                                            <SplineDoubleKeyFrame KeyTime="00:00:00.4" Value="1"/>
                                            <SplineDoubleKeyFrame KeyTime="00:00:00.45" Value="1.05" KeySpline="0,0,0.5,1"/>
                                            <SplineDoubleKeyFrame KeyTime="00:00:00.55" Value="1"/>
                                        </DoubleAnimationUsingKeyFrames>
                                        <DoubleAnimationUsingKeyFrames BeginTime="0" Storyboard.TargetName="PART_ContentRoot" Storyboard.TargetProperty="(RenderTransform).(Children)[0].ScaleY">
                                            <SplineDoubleKeyFrame KeyTime="0" Value="0"/>
                                            <SplineDoubleKeyFrame KeyTime="00:00:00.25" Value="0"/>
                                            <SplineDoubleKeyFrame KeyTime="00:00:00.4" Value="1"/>
                                            <SplineDoubleKeyFrame KeyTime="00:00:00.45" Value="1.05" KeySpline="0,0,0.5,1"/>
                                            <SplineDoubleKeyFrame KeyTime="00:00:00.55" Value="1"/>
                                        </DoubleAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Closed">
                                    <Storyboard>
                                        <DoubleAnimationUsingKeyFrames BeginTime="0" Storyboard.TargetName="PART_Root" Storyboard.TargetProperty="Opacity">
                                            <EasingDoubleKeyFrame KeyTime="00:00:00.25" Value="1"/>
                                            <EasingDoubleKeyFrame KeyTime="00:00:00.45" Value="0"/>
                                        </DoubleAnimationUsingKeyFrames>
                                        <DoubleAnimationUsingKeyFrames BeginTime="0" Storyboard.TargetName="PART_ContentRoot" Storyboard.TargetProperty="(RenderTransform).(Children)[0].ScaleX">
                                            <SplineDoubleKeyFrame KeyTime="00:00:00.2" Value="1"/>
                                            <SplineDoubleKeyFrame KeyTime="00:00:00.25" Value="1.05"/>
                                            <SplineDoubleKeyFrame KeyTime="00:00:00.45" Value="0"/>
                                        </DoubleAnimationUsingKeyFrames>
                                        <DoubleAnimationUsingKeyFrames BeginTime="0" Storyboard.TargetName="PART_ContentRoot" Storyboard.TargetProperty="(RenderTransform).(Children)[0].ScaleY">
                                            <SplineDoubleKeyFrame KeyTime="00:00:00.2" Value="1"/>
                                            <SplineDoubleKeyFrame KeyTime="00:00:00.25" Value="1.05"/>
                                            <SplineDoubleKeyFrame KeyTime="00:00:00.45" Value="0"/>
                                        </DoubleAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="ResizerStates">
                                <VisualStateGroup.Transitions>
                                    <VisualTransition GeneratedDuration="00:00:00.3000000"/>
                                </VisualStateGroup.Transitions>
                                <VisualState x:Name="MouseOver">
                                    <Storyboard>
                                        <DoubleAnimationUsingKeyFrames BeginTime="0" Duration="00:00:00.0010000" Storyboard.TargetName="PART_Resizer" Storyboard.TargetProperty="Opacity">
                                            <SplineDoubleKeyFrame KeyTime="00:00:00" Value="1" />
                                        </DoubleAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Normal">
                                    <Storyboard />
                                </VisualState>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <Grid x:Name="PART_ContentRoot" MinWidth="295" MinHeight="50" Canvas.Left="0" Canvas.Top="0" RenderTransformOrigin="0.5,0.5">
                            <Grid.RenderTransform>
                                <TransformGroup>
                                    <ScaleTransform />
                                    <SkewTransform />
                                    <RotateTransform />
                                    <TranslateTransform />
                                </TransformGroup>
                            </Grid.RenderTransform>
                            <Border VerticalAlignment="Stretch" BorderBrush="#FF000000" BorderThickness="1" CornerRadius="8">
                                <Border.Background>
                                    <LinearGradientBrush EndPoint="0.153999999165535,0.867999970912933" StartPoint="0.591000020503998,0.0230000000447035">
                                        <GradientStop Color="#FF333333" Offset="1"/>
                                        <GradientStop Color="#FF595959" Offset="0.595"/>
                                    </LinearGradientBrush>
                                </Border.Background>
                                <Border CornerRadius="6" Margin="1" BorderThickness="2" BorderBrush="#FF888888">
                                    <Grid>
                                        <Grid.RowDefinitions>
                                            <RowDefinition Height="Auto"/>
                                            <RowDefinition/>
                                        </Grid.RowDefinitions>
                                        <Border x:Name="PART_Chrome">
                                            <Grid Height="20" Width="Auto">
                                                <Grid.ColumnDefinitions>
                                                    <ColumnDefinition/>
                                                    <ColumnDefinition Width="30"/>
                                                </Grid.ColumnDefinitions>
                                                <Path Fill="#48BBBBBB" Stretch="Fill" Height="36.659" Width="260.162" UseLayoutRounding="False" Canvas.Left="-7.977" Canvas.Top="-7.159" Data="M-7.4703331,28.440079 L217.13354,27.951132 C217.13354,27.951132 245.03253,17.04357 251.6855,-7.2626843 C216.35254,-7.5958567 41.13512,-7.2530036 -2.3647556,-7.2530036 C-6.9349985,-7.2530036 -7.5634799,-2.9746757 -7.4700899,-2.485764 C-7.4700899,22.139238 -7.4703331,28.440079 -7.4703331,28.440079 z" HorizontalAlignment="Left" VerticalAlignment="Top"/>
                                                <Path Fill="#48BBBBBB" Stretch="Fill" Height="36.337" Width="258.003" UseLayoutRounding="False" Canvas.Left="-7.977" Canvas.Top="-7.159" Data="M-7.4703331,28.440079 L217.13354,27.951132 C217.13354,27.951132 245.04115,17.064894 251.69412,-7.2413602 C216.36116,-7.5745325 41.13512,-7.2530036 -2.3647556,-7.2530036 C-6.9349985,-7.2530036 -7.5634799,-2.9746757 -7.4700899,-2.485764 C-7.4700899,22.139238 -7.4703331,28.440079 -7.4703331,28.440079 z" HorizontalAlignment="Left" VerticalAlignment="Top"/>
                                                <Path Fill="#48BBBBBB" Stretch="Fill" Height="35.961" Width="255.069" UseLayoutRounding="False" Canvas.Left="-7.977" Canvas.Top="-7.188" Data="M-7.4703331,28.440079 L217.13354,27.951132 C217.13354,27.951132 245.10817,17.003593 251.76114,-7.3026614 C216.42818,-7.6358337 41.13512,-7.2530036 -2.3647556,-7.2530036 C-6.9349985,-7.2530036 -7.5634799,-2.9746757 -7.4700899,-2.485764 C-7.4700899,22.139238 -7.4703331,28.440079 -7.4703331,28.440079 z" HorizontalAlignment="Left" VerticalAlignment="Top"/>

                                                <ContentControl HorizontalAlignment="Stretch" Margin="6,0,6,0" VerticalAlignment="Center" FontWeight="Bold" Foreground="White" IsTabStop="False" Content="{TemplateBinding Title}"/>
                                                <Button x:Name="PART_CloseButton" Height="14" HorizontalAlignment="Center" Style="{StaticResource CloseButtonStyle}" VerticalAlignment="Center" Width="15" IsTabStop="False" Grid.Column="1"/>
                                            </Grid>
                                        </Border>
                                        <ScrollViewer Grid.Row="1" HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Auto" BorderThickness="0" Style="{StaticResource ScrollViewerStyle}">
                                            <Border Background="{TemplateBinding Background}">
                                                <ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Content="{TemplateBinding Content}" ContentTemplate="{TemplateBinding ContentTemplate}"/>
                                            </Border>
                                        </ScrollViewer>
                                        <Path x:Name="PART_Resizer" Fill="#FFB1B1B1" Stretch="Fill" Height="20" HorizontalAlignment="Right" VerticalAlignment="Bottom" Width="20" Opacity=".25" UseLayoutRounding="False" Data="M15.499995,0.5 L15.499995,15.5 L0.5,15.5 z" Grid.Row="1"/>
                                    </Grid>
                                </Border>
                            </Border>
                        </Grid>
                    </Canvas>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

</ResourceDictionary>
